{% extends 'admin/common/base.html' %}
{% block body %}
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-dict-edit">
			<input name="id"  type="hidden" id="id" value="{{d.id}}" />
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">字典标签：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="label" id="label" required value="{{d.label}}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">字典键值：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="value" id="value" required value="{{d.value}}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">字典类型：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" readonly="true" id="dict_type" name="dict_type" value="{{d.dict_type}}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">样式属性：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" id="css_class" name="css_class" value="{{d.css_class}}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">字典排序：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="sort" required id="sort" value="{{d.sort}}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">回显样式：</label>
				<div class="col-sm-8">
					<select name="list_class" class="form-control m-b">
					    <option value="" {%if d.list_class == '' %}selected="selected" {%endif%}>---请选择---</option>
	                    <option value="default" {%if d.list_class == 'default' %}selected="selected" {%endif%}>默认</option>
	                    <option value="primary" {%if d.list_class == 'primary' %}selected="selected" {%endif%}>主要</option>
	                    <option value="success" {%if d.list_class == 'success' %}selected="selected" {%endif%}>成功</option>
	                    <option value="info" {%if d.list_class == 'info' %}selected="selected" {%endif%}>信息</option>
	                    <option value="warning" {%if d.list_class == 'warning' %}selected="selected" {%endif%}>警告</option>
	                    <option value="danger" {%if d.list_class == 'danger' %}selected="selected" {%endif%}>危险</option>
	                </select>
	                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> table表格字典列显示样式属性</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">系统默认：</label>
				<div class="col-sm-8">
					<div class="radio-box">
						<input type="radio" id="12" name="is_default" value="Y" {%if d.is_default == 'Y'%}checked="checked" {%endif%}>
						<label for="12">是</label>
					</div>
					<div class="radio-box">
						<input type="radio" id="13" name="is_default" value="N" {%if d.is_default == 'N'%}checked="checked" {%endif%}>
						<label for="13">否</label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
					<div class="radio-box">
						<input type="radio" id="6" name="status" value="0" {%if d.status == 0 %}checked="checked" {%endif%}>
						<label for="6">正常</label>
					</div>
					<div class="radio-box">
						<input type="radio" id="7" name="status" value="1" {%if d.status == 1 %}checked="checked" {%endif%}>
						<label for="7">停用</label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" class="form-control">{{d.remark}}</textarea>
				</div>
			</div>
		</form>
	</div>
</body>
{% endblock %}
{% block js %}
{{ super() }}
<script type="text/javascript">

	$("#form-dict-edit").validate({
		rules:{
			sort:{
				digits:true
			},
		},
		focusCleanup: true
	});
	
	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save("{{url_for('admin.sys.dict_data.edit')}}", $('#form-dict-edit').serialize());
		}
	}
</script>
{% endblock %}
